Optimal. Leaf size=26 \[ -\frac {b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a \cot (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {2827, 3852, 8,
3855} \begin {gather*} -\frac {a \cot (e+f x)}{f}-\frac {b \tanh ^{-1}(\cos (e+f x))}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2827
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \csc ^2(e+f x) (a+b \sin (e+f x)) \, dx &=a \int \csc ^2(e+f x) \, dx+b \int \csc (e+f x) \, dx\\ &=-\frac {b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a \text {Subst}(\int 1 \, dx,x,\cot (e+f x))}{f}\\ &=-\frac {b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a \cot (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 52, normalized size = 2.00 \begin {gather*} -\frac {a \cot (e+f x)}{f}-\frac {b \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f}+\frac {b \log \left (\sin \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 33, normalized size = 1.27
method | result | size |
derivativedivides | \(\frac {-\cot \left (f x +e \right ) a +b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}\) | \(33\) |
default | \(\frac {-\cot \left (f x +e \right ) a +b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}\) | \(33\) |
risch | \(-\frac {2 i a}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {b \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f}+\frac {b \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f}\) | \(57\) |
norman | \(\frac {-\frac {a}{2 f}+\frac {a \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}+\frac {b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}\) | \(68\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 43, normalized size = 1.65 \begin {gather*} -\frac {b {\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + \frac {2 \, a}{\tan \left (f x + e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 68 vs.
\(2 (28) = 56\).
time = 0.39, size = 68, normalized size = 2.62 \begin {gather*} -\frac {b \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - b \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) + 2 \, a \cos \left (f x + e\right )}{2 \, f \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (e + f x \right )}\right ) \csc ^{2}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 62 vs.
\(2 (28) = 56\).
time = 0.45, size = 62, normalized size = 2.38 \begin {gather*} \frac {2 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) + a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \frac {2 \, b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.76, size = 28, normalized size = 1.08 \begin {gather*} \frac {b\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f}-\frac {a\,\mathrm {cot}\left (e+f\,x\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________